#pragma once 
#include <map>
#include <string>
#include <OgreSingleton.h>

class CSTGState{
public:
    CSTGState();
    inline int getState(const std::string &state) const;
    inline bool setState(const std::string &state, int value);
private:
    std::map<std::string, int> mState;
};
namespace CEGUI {
    class Window;
}
class CSTGScene {
public:
    CSTGScene(const std::string &name);
    virtual void start();
    virtual void pause();
    virtual void resume();
    virtual void update(float dt);
    virtual void exit();
    void setScriptName(const std::string &scriptName);
protected:
    float mSceneTime;
    class CEGUI::Window *mWindow;
    std::string mUIScript;
    std::string mName;
};
class CSTGGame: public Ogre::Singleton<CSTGGame> {
public:
    CSTGGame():mState(NULL) { mState = new CSTGState; }
    ~CSTGGame(){};
    void init();
    void start();
    void restart();
    void pause();
    void resume();
    void exit();
    void update(float dt);
    void changeScene();
    //void input(class OIS::Keyboard *input);
    CSTGState *mState;
protected:
    class CMainController *mMainCtrl;
    std::map<std::string, CSTGScene*> mScenes;
    float mGlobalTime;
    float mGamePlayTime;
};